package com.wakey.rtcs.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ConfigHelper {

	private static Properties properties;
	
	static{
		properties = new Properties();
		InputStream inputStream = null;
		try {
			inputStream = ConfigHelper.class.getClassLoader().getResourceAsStream("config.properties");
			properties.load(inputStream);
		} catch (IOException e) {
			e.printStackTrace();
		} finally{
			if(inputStream != null){
				try {
					inputStream.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
	
	public static String getProperty(String key){
		String str = properties.getProperty(key);
		if(str != null){
			str = str.trim();
		}
		return str;
	}
	
}
